package service

import (
	"context"

	pb "manage/api/user"
	"manage/app/user/internal/biz"
)

type UserServiceService struct {
	pb.UnimplementedUserServiceServer
	bz *biz.UserCase
}

func NewUserServiceService(bz *biz.UserCase) *UserServiceService {
	return &UserServiceService{
		bz: bz,
	}
}

func (s *UserServiceService) AddUser(ctx context.Context, req *pb.AddUserRequest) (*pb.UserResponse, error) {
	return s.bz.CreateUser(ctx, req)
}

func (s *UserServiceService) DeleteUser(ctx context.Context, req *pb.DeleteUserRequest) (*pb.UserResponse, error) {
	return s.bz.DeleteUser(ctx, req)
}

func (s *UserServiceService) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.UserResponse, error) {
	return s.bz.UpdateUser(ctx, req)
}

func (s *UserServiceService) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.UserResponse, error) {
	return s.bz.GetUser(ctx, req)
}
func (s *UserServiceService) GetUserList(ctx context.Context, req *pb.GetUserListRequest) (*pb.GetUserListReply, error) {
	return s.bz.GetUserList(ctx, req)
}
